/*********************************************************************
*
* Software License Agreement ()
*
*  Copyright (c) 2020, HINS, Inc.
*  All rights reserved.
*
* Author: Hu Liankui
* Create Date: 8/9/2020
*********************************************************************/

#pragma once

#include <array>
#include <vector>

namespace hins {

const std::array<unsigned char, 8> kStartCapture {0x52, 0x41, 0x75, 0x74, 0x6f, 0x01, 0x87, 0x80};

struct ScanData
{
  // 距离数据
  std::vector<std::uint32_t> distance_data;
  
  // 强度数据
  std::vector<std::uint32_t> amplitude_data;
};

struct AreaData
{
std::array<unsigned char, 8> identifier;    // 标识符
char channel;                               // 传感器通道值
char input_state;
char output_state;
char led_state;
uint16_t error_state;
uint16_t check;
};


struct ShadowsFilterParam
{
  float min_angle;
  float max_angle;
  int neighbors;            // 删除窗口
  int window;               // 搜索计算窗口
  int shadows_filter_level; 
  int traverse_step;          // 遍历步长
};

#pragma pack(1)

struct XSPackageHeader
{
  char head[6];              // 5个标识符+一个预留位
  uint16_t start_angle;      // 起始角度
  uint16_t end_angle;        // 终止角度
  uint16_t data_size;        // 这个包里面总的测量点数
};

const uint16_t kXSPackageHeadSize = sizeof(XSPackageHeader);
const uint16_t kXSAreaDataSize = sizeof(AreaData);
const uint16_t kMaxDistance = 10000;
const uint16_t kMaxIntensity = 30000;


#pragma pack()


}

